#pragma once

#include <QObject>
#include <QVariantMap>

class  ubNotificationCenter : public QObject
{
	Q_OBJECT



public:
	static ubNotificationCenter* defaultCenter(const char* identify = nullptr);
	void postNotification(const QString name = QString(), const QObject* sender = nullptr,  QVariantMap *userInfo = nullptr);
	int addObserver( QObject* receiver, const char* method, const QString& name = QString(), const QObject* sender = nullptr);
	int removeObserver(const QObject* receiver, const QString& name = QString(), const QObject* sender = nullptr);

	~ubNotificationCenter();

private:

  	QMap<QString,  QObject*> m_senderMap;
	ubNotificationCenter(QString name = QString(), QObject* parent = nullptr);


};

